<template>
	<view class="page">
		<view class="wrapper">
			<view class="padding grids">
				<view class="grid" style="border-bottom: 1px solid #3F4254;border-right: 1px solid #3F4254;">
					<view class="number active">
						{{my.mine}}
					</view>
					<view class="title">
						我的矿机(台)
					</view>
				</view>
				<view class="grid" style="border-bottom: 1px solid #3F4254;">
					<view class="number active">
						{{my.total_mine}}
					</view>
					<view class="title">
						总业绩(台)
					</view>
				</view>
				<view class="grid" style="border-right: 1px solid #3F4254;">
					<view class="number active">
						{{my.yesterday}}
					</view>
					<view class="title">
						昨日收益(usdt)
					</view>
				</view>
				<view class="grid">
					<view class="number active">
						{{my.total}}
					</view>
					<view class="title">
						累计收益(usdt)
					</view>
				</view>
			</view>
		
			<view class="block-title">
				<image class="img" src="../../static/images/users.png" mode="aspectFill"></image>
				<view class="title">
					我的推广
				</view>
			</view>
			
			<view class="list">
				<view class="card" v-for="(i,k) in list" :key="i.id">
					<view class="top">
						<view class="left">
							<view style="font-size: 24rpx;margin-right: 10rpx;">
								UID
							</view>
							<view style="color: #fff;">
								{{i.uid}}
							</view>
							<view class="cu-tag radius sm" :class="'level'+i.level+'-tag'">
								{{i.level_name}}
							</view>
						</view>
						<view class="right">
							矿机：{{i.mine}}
						</view>
					</view>
					<view class="grids">
						<view class="grid">
							<view class="number active">
								{{i.level_count.level_1}}
							</view>
							<view class="title">
								普通专员
							</view>
						</view>
						<view class="grid">
							<view class="number active">
								{{i.level_count.level_2}}
							</view>
							<view class="title">
								业务专员
							</view>
						</view>
						<view class="grid">
							<view class="number active">
								{{i.level_count.level_3}}
							</view>
							<view class="title">
								销售主管
							</view>
						</view>
						<view class="grid">
							<view class="number active">
								{{i.level_count.level_4}}
							</view>
							<view class="title">
								销售经理
							</view>
						</view>
						<view class="grid">
							<view class="number active">
								{{i.level_count.level_5}}
							</view>
							<view class="title">
								销售总监
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				my: ''
			}
		},
		onLoad() {
			this.getList();
		},
		methods: {
			getList() {
				this.$u.get('/member/community').then(res => {
					this.list = res.data.result.community
					this.my = res.data.result.my
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import url("/colorui/main.css");
	
	.grids {
		display: flex;
		flex-flow: row wrap;
		justify-content: space-around;
		font-size: 32rpx;
	}
	.grid {
		display: flex;
		flex-flow: column;
		align-items: center;
		width: 50%;
		box-sizing: border-box;
		padding: 40rpx 0;
	}
	.grid .number {
		margin-bottom: 10rpx;
		font-size: 36rpx;
		font-weight: bold;
	}
	
	.list .card {
		background: #1B1B3B;
		border-radius: 10rpx;
		margin-bottom: 30rpx;
	}
	.list .card .top {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx 30rpx 0 30rpx;
		.left {
			display: flex;
			align-items: center;
			
			.cu-tag {
				background: #00D688;
				color: #fff;
				margin-left: 40rpx;
			}
		}
		.right {
			font-size: 28rpx;
		}
	}
	.list .grid {
		font-size: 26rpx;
		width: 20%;
	}
	
	
	.block-title {
		padding: 20rpx 0;
		margin: 20rpx 0;
		display: flex;
		align-items: center;
	}
	.block-title .img {
		width: 40rpx;
		height: 40rpx;
	}
	.block-title .title {
		color: #fff;
		margin-left: 20rpx;
	}
</style>
